Skip to content

replace !persisted with new_record? and !empty? with any? - #3091

Merged
edwinthinks merged 1 commit into
rubyforgood:mainfrom
italomatos:improve-syntax
Aug 20, 2022
Merged

edwinthinks merged 1 commit into
rubyforgood:mainfrom
italomatos:improve-syntax

Conversation

@italomatos

@italomatos italomatos commented Aug 17, 2022 •

Copy link
Copy Markdown
Contributor

Description

This PR has the goal to improve code syntax, using some tips of clean code book

  • replace !something.empty? with something.any?
  • replace !something.new_record? with something.persisted?
  • replace !something.persisted? with something.new_record?

@edwinthinks edwinthinks left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This is much cleaner thank you @italomatos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants